import React from 'react'
import { connect } from 'dva'
import Prolist from './index'

const Products = function eshow({ dispatch, products }) {
    function handleDelete(id) {
        dispatch({ type: 'products/delete', payload: id })
    }
    return (
        <div>
            {
                console.log(123456)
            }
            <Prolist onDelete={handleDelete} products={products}></Prolist>
        </div >
    )
}

function mapStateToProps({ products }) {
    return { products }
}


export default connect(mapStateToProps)(Products);